package com.tlgen.model;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @author: tlgen
 * @Discription:
 */
@Data
public class Department {
    private Integer id;
    private String name;
    private Integer parentId;
    private String depPath;
    private Boolean enabled;
    private Boolean isParent;

    private List<Department> children = new ArrayList<>();

    //调用存储过程需要用
    private Integer result;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Department that = (Department) o;
        return name.equals(that.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name);
    }

    public Department(String name) {
        this.name = name;
    }

    public Department() {
    }
}
